<template>
    <view class="container">
        <!-- <hx-navbar ref="hxnb" :config="config" id="nav"></hx-navbar> -->
        <!-- <micro-temp ref="microTemp" :url="url"></micro-temp> -->
        <view class="content">
            <rich-text @tap="showImg" :nodes="formatRichTextFn(Content ? Content : '')">
            </rich-text>
        </view>
    </view>
</template>

<script>
import microTemp from "@/pages/micro/temp.vue"
import webViewUrl from "@/pages/micro/webViewUrl.js"
import storage from "@/uni-sub-base/utils/storage.js"
import { GetInfoByType } from "@/service/api/member.js"
import { formatRichText, getElementTop } from "@/uni-sub-base/utils/elementUtil.js"
export default {
    components: {
        microTemp,
    },
    data() {
        return {
            config: {
                back: false,
                title: "",
                barPlaceholder: false,
                backgroundColor: [1, "#4E7CFF"],
            },
            canReturn: false,
            url: "",
            Content: '',
        }
    },
    onLoad(e) {
        // let token = storage.getCache("token")
        // this.url = e.url + "?type=" + e.type
        if (e.type) {
            this.getInfoByType(e.type)
        }
    },
    mounted() { },
    onShow() { },
    methods: {
        getInfoByType(type) {
            GetInfoByType(type).then((res) => {
                this.Content = res.Data.Content
                uni.setNavigationBarTitle({
                    title: res.Data.Title ? res.Data.Title : "协议",
                })
            })
        },
        formatRichTextFn(text) {
            return formatRichText(text)
        },
    },
}
</script>

<style lang="scss">
.content {
    padding: $app-page-padding;
}
</style>
